package com.yqd.lesson.remote

import akka.actor.Actor

class CalculateActor extends Actor {
  override def receive: Receive = {
    case Add(left,right) => {
      println(s"left $left right $right")
      sender() ! AddResult(left,right,left + right);
    }
    case _ => {
      println(self.path);
    }
  }

}




trait MathOp;

@SerialVersionUID(-4486938584926174252L)//使用注解来制定序列化id
final case class Add(left:Int,right:Int) extends Serializable with MathOp;

@SerialVersionUID(-4486938584926174253L)//使用注解来制定序列化id
final case class AddResult(left:Int,right:Int,result:Int) extends Serializable with MathOp;

